<?php
/**
 * [WeEngine System] Copyright (c) 2013 WE7.CC
 * $sn$
 */
require './framework/bootstrap.inc.php';

error_reporting(E_ALL);

unset($_SERVER, $_ENV);

$lower_class = strtolower($class);
if (empty($lower_class)) {
	api_return_error(error(1, '云API调用失败: 非法访问'));
}

include "userapi/{$lower_class}/{$lower_class}.php";

$methods = get_class_methods($class);
if (empty($methods) || !in_array($method, $methods)) {
	api_return_error(error(1, '云API调用失败: 不存在 METHOD "'.$method.'" .'));
}
unset($methods, $lower_class);

$apiObj = new $class();
$apiObj->$method($_GPC);
